package com.itheima.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 演示springmvc的执行流程
 */
@Slf4j
@Controller
@RequestMapping("/account")
public class AccountController {

    /**
     * 页面跳转
     * @return
     */
    @GetMapping("/resp1")
    public  String resp1(){
        log.info("AccountController.resp1()...");
        return "/success.html";
    }

    /**
     * 响应数据
     * @return
     */
    @GetMapping("/resp2")
    @ResponseBody
    public  String resp2(){
        log.info("AccountController.resp2()...");
        return "resp2...";
    }
}
